<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
   
  <meta name="keywords" content="Java Python" />
   
  <meta name="description" content="From Zero to Hero" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>
    计算机组成原理-02-进制与编码 |  朱酱酱的学习博客
  </title>
  <meta name="generator" content="hexo-theme-yilia-plus">
  
  <link rel="shortcut icon" href="/favicon.ico" />
  
  
<link rel="stylesheet" href="/css/style.css">

  
<script src="/js/pace.min.js"></script>


  

  

<link rel="alternate" href="/atom.xml" title="朱酱酱的学习博客" type="application/atom+xml">
</head>

</html>

<body>
  <div id="app">
    <main class="content">
      <section class="outer">
  <article id="post-Compute_Organization/计组-02-进制与编码" class="article article-type-post" itemscope
  itemprop="blogPost" data-scroll-reveal>

  <div class="article-inner">
    
    <header class="article-header">
       
<h1 class="article-title sea-center" style="border-left:0" itemprop="name">
  计算机组成原理-02-进制与编码
</h1>
  

    </header>
    

    
    <div class="article-meta">
      <a href="/2021/03/25/Compute_Organization/%E8%AE%A1%E7%BB%84-02-%E8%BF%9B%E5%88%B6%E4%B8%8E%E7%BC%96%E7%A0%81/" class="article-date">
  <time datetime="2021-03-25T03:02:24.000Z" itemprop="datePublished">2021-03-25</time>
</a>
      
      
      
<div class="word_count">
    <span class="post-time">
        <span class="post-meta-item-icon">
            <i class="ri-quill-pen-line"></i>
            <span class="post-meta-item-text"> 字数统计:</span>
            <span class="post-count">2.3k字</span>
        </span>
    </span>

    <span class="post-time">
        &nbsp; | &nbsp;
        <span class="post-meta-item-icon">
            <i class="ri-book-open-line"></i>
            <span class="post-meta-item-text"> 阅读时长≈</span>
            <span class="post-count">9分钟</span>
        </span>
    </span>
</div>

      
    </div>
    

    
    
    <div class="tocbot"></div>





    

    <div class="article-entry" itemprop="articleBody">
      


      

      
      <h2 id="计算机组成原理-02-数据的表示和运算"><a href="#计算机组成原理-02-数据的表示和运算" class="headerlink" title="计算机组成原理-02-数据的表示和运算"></a>计算机组成原理-02-数据的表示和运算</h2><h2 id="1-进制概述"><a href="#1-进制概述" class="headerlink" title="1. 进制概述"></a>1. 进制概述</h2><ol>
<li><strong>使用二进制的原因</strong><ul>
<li>二进制只有两种状态，物理电路的高电平和低电平可以很好的表示0和1</li>
<li>二进制的0和1正好可以分别代表 true 和 false</li>
<li>二进制的运算规则特别适合逻辑门电路的计算</li>
</ul>
</li>
</ol>
<a id="more"></a>

<ul>
<li><strong>10进制</strong></li>
</ul>
<blockquote>
<p>先说 我们最 熟悉的 10进制 , 就是 用 0~9 的数表示 , 逢 10 进 1 .</p>
</blockquote>
<ul>
<li><strong>16进制</strong></li>
</ul>
<blockquote>
<p>如果是 16 进制 , 它就是 由 0-9，A-F组成， 与10进制的对应关系是：0-9 对应 0-9；A-F对应10-15；<br>字母不区分大小写。</p>
</blockquote>
<ul>
<li><strong>2进制 和 8进制</strong></li>
</ul>
<blockquote>
<p>2进制 由 0-1组成</p>
<p>8进制 由 0-7组成</p>
</blockquote>
<p><strong>再看几个特别的例子：</strong></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"># 写出各个进制1-20</span><br><span class="line"></span><br><span class="line"># 一进制 </span><br><span class="line">1</span><br><span class="line">1 1</span><br><span class="line">1 1 1</span><br><span class="line">1 1 1 1</span><br><span class="line">.....</span><br><span class="line"></span><br><span class="line"># 三进制</span><br><span class="line">0 	1 	2</span><br><span class="line">10	11	12</span><br><span class="line">20	21	22</span><br><span class="line">100	101	102</span><br><span class="line">110	111	112</span><br><span class="line">120	121	122</span><br><span class="line">1000 .....</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 七进制</span><br><span class="line">0	1	2	3	4	5	6</span><br><span class="line">10	11	12	13	14	15	16</span><br><span class="line">20	21	22	23	24	25	26</span><br><span class="line">30	31	32	33	34	35	36</span><br><span class="line"></span><br><span class="line"># 十进制(自己定义)</span><br><span class="line">0 1 2 3 4 5 6 7 8 9        10  11 12</span><br><span class="line">0 2 4 6 8 9 a c d f 	   20  22 24</span><br></pre></td></tr></table></figure>



<ul>
<li><strong>八进制</strong></li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"># 八进制计算下面结果</span><br><span class="line"></span><br><span class="line">2 + 3 &#x3D; 5</span><br><span class="line">2 * 3 &#x3D; 6</span><br><span class="line">4 + 5 &#x3D; 11</span><br><span class="line">4 * 5 &#x3D; 24</span><br><span class="line"></span><br><span class="line"># 运算的本质就是查数</span><br><span class="line">0 1 2 3 4 5 6 7 </span><br><span class="line">10 11 12 13 14 15 16 17</span><br><span class="line">20 21 22 23 24 25 26 27</span><br><span class="line"></span><br><span class="line">八进制计算  (进位和计算)</span><br><span class="line">277 + 333 &#x3D; </span><br><span class="line">276 * 54 &#x3D; </span><br><span class="line">237 - 54 &#x3D; </span><br><span class="line">234 &#x2F; 4 &#x3D;</span><br></pre></td></tr></table></figure>



<ul>
<li><strong>各种进制的乘法表</strong>：<a href="https://wenku.baidu.com/view/ee774a731ed9ad51f01df252.html" target="_blank" rel="noopener">https://wenku.baidu.com/view/ee774a731ed9ad51f01df252.html</a></li>
</ul>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">**八进制乘法表**</span><br></pre></td></tr></table></figure>

<table>
<thead>
<tr>
<th>1*1 = 1</th>
<th>1*2 = 2</th>
<th>1*3 = 3</th>
<th>1*4 =4</th>
<th>1*5 =5</th>
<th>1*6 = 6</th>
<th>1*7 = 7</th>
</tr>
</thead>
<tbody><tr>
<td>2*2 = 2</td>
<td>2*3 = 6</td>
<td>2*4 = 10</td>
<td>2*5 = 12</td>
<td>2*6 = 14</td>
<td>2*7 = 16</td>
<td></td>
</tr>
<tr>
<td>3*3 = 11</td>
<td>3*4 = 14</td>
<td>3*5 = 17</td>
<td>3* 6 = 22</td>
<td>3*7 = 25</td>
<td></td>
<td></td>
</tr>
<tr>
<td>4*4 = 20</td>
<td>4 * 5= 24</td>
<td>4*6 = 30</td>
<td>4*7 = 34</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>5*5 = 31</td>
<td>5*6 = 36</td>
<td>5*7 = 43</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>6*6 = 44</td>
<td>6*7 = 52</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>7*7 = 61</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<h2 id="2-进制转换"><a href="#2-进制转换" class="headerlink" title="2. 进制转换"></a>2. 进制转换</h2><ul>
<li>所谓进位计数法是一种计数方法，咱们最常用的莫过于十进制了，除此之外还有八进制、十六进制等。</li>
<li>这里不得不提几个概念术语：<ul>
<li>基数：比如说十进制、八进制和十六进制，它们的基数分别为10（0<del>9）、8（0</del>7）、16（0~15）</li>
<li>数位：比如二进制数1010，这里就有4个数位，从高位到低位依次的数码值为1、0、1、1</li>
<li>数码：比如八进制，那么数码，即数码值的范围为（0~7）</li>
<li>基数和数码的关系：每个数位所用到的不同数码的个数称为基</li>
<li>位权：每个数码所表示的数值等于该数码值乘以一个与它所在位有关的常数，这个常数称为位权。</li>
</ul>
</li>
</ul>
<ol start="2">
<li><strong>二进制转换为八进制和十六进制</strong></li>
</ol>
<p><img src="http://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20210326-085929193.png" alt="mark"></p>
<ol start="3">
<li><strong>十进制转换成二进制</strong></li>
</ol>
<p><img src="http://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20210326-090058906.png" alt="mark"></p>
<p><strong>注意：</strong></p>
<ul>
<li><strong>不是每一个十进制小数都可以准确的用二进制表示<code>，比如：0.3转换为二进制数，无论经过多少次</code>乘二取整<code>都</code>无法获得精确<code>的结果。</code>但任意一个二进制小数都可以用十进制小数表示！！！</strong></li>
</ul>
<h2 id="3-真值，机器数"><a href="#3-真值，机器数" class="headerlink" title="3. 真值，机器数"></a>3. 真值，机器数</h2><ul>
<li><strong>真值</strong>：我们日常见到的，有<code>“+”、“-”</code>号的数为真值，比如：+5，-7。真值是机器数所代表的实际值，一般为十进制数。</li>
<li><strong>机器数</strong>：将<code>“符号-&gt;数字化”</code>的数。一般为二进制数，比如带符号位的4位二进制数<strong>0</strong>110，最高位<code>0</code>就是符号位，这个数的<code>真值就是+6</code>。通常<code>0</code>代表“+”号，<code>1</code>代表<code>-</code>号。</li>
</ul>
<h2 id="4-BCD-码"><a href="#4-BCD-码" class="headerlink" title="4. BCD 码"></a>4. BCD 码</h2><ul>
<li><p>简单来说：就是用<strong>4位二进制数来表示1位十进制数（0—9）</strong>，是一种用二进制编码来代替十进制编码的方式。</p>
</li>
<li><p>BCD码可分为两类：<code>有权码和无权码</code></p>
</li>
<li><p>这种编码方法使得二进制数和十进制数之间的转换十分的快速，但4位二进制数字可以转换出16中代码的组合，因此会有6种冗余的状态。</p>
</li>
</ul>
<p><img src="http://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20210326-090452539.png" alt="mark"></p>
<h3 id="4-1-8421码"><a href="#4-1-8421码" class="headerlink" title="4.1 8421码"></a>4.1 8421码</h3><ul>
<li><strong>其中最常用的BCD码就是8421码</strong></li>
<li>当两个8421码进行计算时，如果结果<code>小于等于9</code>，则不作任何操作</li>
<li>如果计算结果<code>大于9</code>则需要进行+6的修正操作（10-18（9+9）需要进行修正，1010-10010范围）需要进行修正操作，并向高位进位</li>
</ul>
<p><img src="http://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20210326-090727440.png" alt="mark"></p>
<h2 id="5-ASCII-码"><a href="#5-ASCII-码" class="headerlink" title="5. ASCII 码"></a>5. ASCII 码</h2><p>ASCII码大致由三部分组成： </p>
<ol>
<li><strong>ASCII 打印字符：</strong>数字 32–126 分配给了能在键盘上找到的字符，当您查看或打印文档时就会出现。注：十进制32代表空格 ，十进制数字 127 代表 DELETE 命令。下面是ASCII码和相应数字的对照表</li>
</ol>
<table>
<thead>
<tr>
<th>ASCII 码</th>
<th>字符</th>
<th></th>
<th>ASCII 码</th>
<th>字符</th>
<th></th>
<th>ASCII 码</th>
<th>字符</th>
<th></th>
<th>ASCII 码</th>
<th>字符</th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>十进位</td>
<td>十六进位</td>
<td></td>
<td>十进位</td>
<td>十六进位</td>
<td></td>
<td>十进位</td>
<td>十六进位</td>
<td></td>
<td>十进位</td>
<td>十六进位</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>032</td>
<td>20</td>
<td></td>
<td></td>
<td>056</td>
<td>38</td>
<td>8</td>
<td></td>
<td>080</td>
<td>50</td>
<td>P</td>
<td></td>
<td>104</td>
<td>68</td>
<td>h</td>
</tr>
<tr>
<td>033</td>
<td>21</td>
<td>!</td>
<td></td>
<td>057</td>
<td>39</td>
<td>9</td>
<td></td>
<td>081</td>
<td>51</td>
<td>Q</td>
<td></td>
<td>105</td>
<td>69</td>
<td>i</td>
</tr>
<tr>
<td>034</td>
<td>22</td>
<td>“</td>
<td></td>
<td>058</td>
<td>3A</td>
<td>:</td>
<td></td>
<td>082</td>
<td>52</td>
<td>R</td>
<td></td>
<td>106</td>
<td>6A</td>
<td>j</td>
</tr>
<tr>
<td>035</td>
<td>23</td>
<td>#</td>
<td></td>
<td>059</td>
<td>3B</td>
<td>;</td>
<td></td>
<td>083</td>
<td>53</td>
<td>S</td>
<td></td>
<td>107</td>
<td>6B</td>
<td>k</td>
</tr>
<tr>
<td>036</td>
<td>24</td>
<td>$</td>
<td></td>
<td>060</td>
<td>3C</td>
<td>&lt;</td>
<td></td>
<td>084</td>
<td>54</td>
<td>T</td>
<td></td>
<td>108</td>
<td>6C</td>
<td>l</td>
</tr>
<tr>
<td>037</td>
<td>25</td>
<td>%</td>
<td></td>
<td>061</td>
<td>3D</td>
<td>=</td>
<td></td>
<td>085</td>
<td>55</td>
<td>U</td>
<td></td>
<td>109</td>
<td>6D</td>
<td>m</td>
</tr>
<tr>
<td>038</td>
<td>26</td>
<td>&amp;</td>
<td></td>
<td>062</td>
<td>3E</td>
<td>&gt;</td>
<td></td>
<td>086</td>
<td>56</td>
<td>V</td>
<td></td>
<td>110</td>
<td>6E</td>
<td>n</td>
</tr>
<tr>
<td>039</td>
<td>27</td>
<td>‘</td>
<td></td>
<td>063</td>
<td>3F</td>
<td>?</td>
<td></td>
<td>087</td>
<td>57</td>
<td>W</td>
<td></td>
<td>111</td>
<td>6F</td>
<td>o</td>
</tr>
<tr>
<td>040</td>
<td>28</td>
<td>(</td>
<td></td>
<td>064</td>
<td>40</td>
<td>@</td>
<td></td>
<td>088</td>
<td>58</td>
<td>X</td>
<td></td>
<td>112</td>
<td>70</td>
<td>p</td>
</tr>
<tr>
<td>041</td>
<td>29</td>
<td>)</td>
<td></td>
<td>065</td>
<td>41</td>
<td>A</td>
<td></td>
<td>089</td>
<td>59</td>
<td>Y</td>
<td></td>
<td>113</td>
<td>71</td>
<td>q</td>
</tr>
<tr>
<td>042</td>
<td>2A</td>
<td>*</td>
<td></td>
<td>066</td>
<td>42</td>
<td>B</td>
<td></td>
<td>090</td>
<td>5A</td>
<td>Z</td>
<td></td>
<td>114</td>
<td>72</td>
<td>r</td>
</tr>
<tr>
<td>043</td>
<td>2B</td>
<td>+</td>
<td></td>
<td>067</td>
<td>43</td>
<td>C</td>
<td></td>
<td>091</td>
<td>5B</td>
<td>[</td>
<td></td>
<td>115</td>
<td>73</td>
<td>s</td>
</tr>
<tr>
<td>044</td>
<td>2C</td>
<td>,</td>
<td></td>
<td>068</td>
<td>44</td>
<td>D</td>
<td></td>
<td>092</td>
<td>5C</td>
<td>\</td>
<td></td>
<td>116</td>
<td>74</td>
<td>t</td>
</tr>
<tr>
<td>045</td>
<td>2D</td>
<td>-</td>
<td></td>
<td>069</td>
<td>45</td>
<td>E</td>
<td></td>
<td>093</td>
<td>5D</td>
<td>]</td>
<td></td>
<td>117</td>
<td>75</td>
<td>u</td>
</tr>
<tr>
<td>046</td>
<td>2E</td>
<td>.</td>
<td></td>
<td>070</td>
<td>46</td>
<td>F</td>
<td></td>
<td>094</td>
<td>5E</td>
<td>^</td>
<td></td>
<td>118</td>
<td>76</td>
<td>v</td>
</tr>
<tr>
<td>047</td>
<td>2F</td>
<td>/</td>
<td></td>
<td>071</td>
<td>47</td>
<td>G</td>
<td></td>
<td>095</td>
<td>5F</td>
<td>_</td>
<td></td>
<td>119</td>
<td>77</td>
<td>w</td>
</tr>
<tr>
<td>048</td>
<td>30</td>
<td>0</td>
<td></td>
<td>072</td>
<td>48</td>
<td>H</td>
<td></td>
<td>096</td>
<td>60</td>
<td>`</td>
<td></td>
<td>120</td>
<td>78</td>
<td>x</td>
</tr>
<tr>
<td>049</td>
<td>31</td>
<td>1</td>
<td></td>
<td>073</td>
<td>49</td>
<td>I</td>
<td></td>
<td>097</td>
<td>61</td>
<td>a</td>
<td></td>
<td>121</td>
<td>79</td>
<td>y</td>
</tr>
<tr>
<td>050</td>
<td>32</td>
<td>2</td>
<td></td>
<td>074</td>
<td>4A</td>
<td>J</td>
<td></td>
<td>098</td>
<td>62</td>
<td>b</td>
<td></td>
<td>122</td>
<td>7A</td>
<td>z</td>
</tr>
<tr>
<td>051</td>
<td>33</td>
<td>3</td>
<td></td>
<td>075</td>
<td>4B</td>
<td>K</td>
<td></td>
<td>099</td>
<td>63</td>
<td>c</td>
<td></td>
<td>123</td>
<td>7B</td>
<td>{</td>
</tr>
<tr>
<td>052</td>
<td>34</td>
<td>4</td>
<td></td>
<td>076</td>
<td>4C</td>
<td>L</td>
<td></td>
<td>100</td>
<td>64</td>
<td>d</td>
<td></td>
<td>124</td>
<td>7C</td>
<td>|</td>
</tr>
<tr>
<td>053</td>
<td>35</td>
<td>5</td>
<td></td>
<td>077</td>
<td>4D</td>
<td>M</td>
<td></td>
<td>101</td>
<td>65</td>
<td>e</td>
<td></td>
<td>125</td>
<td>7D</td>
<td>}</td>
</tr>
<tr>
<td>054</td>
<td>36</td>
<td>6</td>
<td></td>
<td>078</td>
<td>4E</td>
<td>N</td>
<td></td>
<td>102</td>
<td>66</td>
<td>f</td>
<td></td>
<td>126</td>
<td>7E</td>
<td>~</td>
</tr>
<tr>
<td>055</td>
<td>37</td>
<td>7</td>
<td></td>
<td>079</td>
<td>4F</td>
<td>O</td>
<td></td>
<td>103</td>
<td>67</td>
<td>g</td>
<td></td>
<td>127</td>
<td>7F</td>
<td>DEL</td>
</tr>
</tbody></table>
<ol start="2">
<li><strong>ASCII 非打印控制字符：</strong>ASCII 表上的数字 0–31 分配给了控制字符，用于控制像打印机等一些外围设备。例如，12 代表换页/新页功能。此命令指示打印机跳到下一页的开头。</li>
</ol>
<p><img src="http://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20210326-091133175.png" alt="mark"></p>
<ol start="3">
<li><strong>扩展 ASCII 打印字符：</strong>扩展的 ASCII 字符满足了对更多字符的需求。扩展的 ASCII 包含 ASCII 中已有的 128 个字符（数字 0–32 显示在下图中），又增加了 128 个字符，总共是 256 个。即使有了这些更多的字符，许多语言还是包含无法压缩到 256 个字符中的符号。因此，出现了一些 ASCII 的变体来囊括地区性字符和符号.</li>
</ol>
<p><img src="http://zhuuu-bucket.oss-cn-beijing.aliyuncs.com/img/20210326-091206473.png" alt="mark"></p>
<p><strong>注意：</strong></p>
<ul>
<li>0-9的ASCII码值位48（0110000）-57（0111001）</li>
<li>即去掉高3位，只保留四位的话，正好是二进制的0-9</li>
<li>大写字母和小写字母转换成二进制也是同样的道理</li>
</ul>
<h2 id="6-汉字编码"><a href="#6-汉字编码" class="headerlink" title="6. 汉字编码"></a>6. 汉字编码</h2><ul>
<li><code>分类</code>：计算机中汉字的表示也是用二进制编码，同样是人为编码的。根据应用目的的不同，汉字编码分为外码、交换码、机内码和字形码。</li>
</ul>
<ol>
<li>外码（输入码）</li>
</ol>
<ul>
<li>外码也叫输入码，是用来将汉字输入到计算机中的一组键盘符号。常用的输入码有拼音码、五笔字型码、自然码、表形码、认知码、区位码和电报码等</li>
</ul>
<ol start="2">
<li>交换码(国标码)</li>
</ol>
<ul>
<li>计算机内部处理的信息，都是用二进制代码表示的，汉字也不例外。</li>
<li>而二进制代码使用起来是不方便的，于是需要采用信息交换码。中国标准总局1981年制定了中华人民共和国国家标准GB2312–80《信息交换用汉字编码字符集–基本集》<strong>，即国标码。</strong></li>
<li>区位码是国标码的另一种表现形式，把国标GB2312–80中的汉字、图形符号组成一个<strong>94×94的方阵，分为94个“区”</strong>，每区包含94个“位”，其中“区”的序号由01至94，“位”的序号也是从01至94。</li>
<li>94个区中位置总数=94×94=8836个，其中7445个汉字和图形字符中的每一个占一个位置后，还剩下1391个空位，这1391个位置空下来保留备用。</li>
</ul>
<ol start="3">
<li>机内码</li>
</ol>
<ul>
<li>根据国标码的规定，每一个汉字都有了确定的二进制代码，在微机内部汉字代码都用机内码<strong>，在磁盘上记录汉字代码也使用机内码。</strong></li>
</ul>
<ol start="4">
<li>字形码</li>
</ol>
<ul>
<li>字形码是汉字的输出码，输出汉字时都采用图形方式，无论汉字的笔画多少，每个汉字都可以写在同样大小的方块中。通常用16×16点阵来显示汉字。</li>
<li>其实也就是0101的网格 （类似于Banner）</li>
</ul>
<p><strong>转换关系</strong></p>
<ul>
<li>国际码 = （区位码）+ 2020H<ul>
<li>20H = 32 ：为了传输的时候避开前32个控制字符</li>
</ul>
</li>
<li>汉字内码 = （国际码）+ 8080H<ul>
<li>80H = 128: 为了与英文的ASCII码兼容</li>
</ul>
</li>
</ul>

      
      <!-- reward -->
      
      <div id="reward-btn">
        打赏
      </div>
      
    </div>
      <!-- copyright -->
      
        <div class="declare">
          <ul class="post-copyright">
            <li>
              <i class="ri-copyright-line"></i>
              <strong>版权声明： </strong s>
              本博客所有文章除特别声明外，均采用 <a href="https://www.apache.org/licenses/LICENSE-2.0.html" rel="external nofollow"
                target="_blank">Apache License 2.0</a> 许可协议。转载请注明出处！
            </li>
          </ul>
        </div>
        
    <footer class="article-footer">
      
          
<div class="share-btn">
      <span class="share-sns share-outer">
        <i class="ri-share-forward-line"></i>
        分享
      </span>
      <div class="share-wrap">
        <i class="arrow"></i>
        <div class="share-icons">
          
          <a class="weibo share-sns" href="javascript:;" data-type="weibo">
            <i class="ri-weibo-fill"></i>
          </a>
          <a class="weixin share-sns wxFab" href="javascript:;" data-type="weixin">
            <i class="ri-wechat-fill"></i>
          </a>
          <a class="qq share-sns" href="javascript:;" data-type="qq">
            <i class="ri-qq-fill"></i>
          </a>
          <a class="douban share-sns" href="javascript:;" data-type="douban">
            <i class="ri-douban-line"></i>
          </a>
          <!-- <a class="qzone share-sns" href="javascript:;" data-type="qzone">
            <i class="icon icon-qzone"></i>
          </a> -->
          
          <a class="facebook share-sns" href="javascript:;" data-type="facebook">
            <i class="ri-facebook-circle-fill"></i>
          </a>
          <a class="twitter share-sns" href="javascript:;" data-type="twitter">
            <i class="ri-twitter-fill"></i>
          </a>
          <a class="google share-sns" href="javascript:;" data-type="google">
            <i class="ri-google-fill"></i>
          </a>
        </div>
      </div>
</div>

<div class="wx-share-modal">
    <a class="modal-close" href="javascript:;"><i class="ri-close-circle-line"></i></a>
    <p>扫一扫，分享到微信</p>
    <div class="wx-qrcode">
      <img src="//api.qrserver.com/v1/create-qr-code/?size=150x150&data=http://zhuuu.work/2021/03/25/Compute_Organization/%E8%AE%A1%E7%BB%84-02-%E8%BF%9B%E5%88%B6%E4%B8%8E%E7%BC%96%E7%A0%81/" alt="微信分享二维码">
    </div>
</div>

<div id="share-mask"></div>
      
      
  <ul class="article-tag-list" itemprop="keywords"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80%E7%90%86%E8%AE%BA/" rel="tag">计算机基础理论</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BB%84%E6%88%90%E5%8E%9F%E7%90%86/" rel="tag">计算机组成原理</a></li></ul>


    </footer>

  </div>

  
  
  <nav class="article-nav">
    
      <a href="/2021/03/26/Compute_Organization/%E8%AE%A1%E7%BB%84-03-%E6%A0%A1%E9%AA%8C%E7%A0%81/" class="article-nav-link">
        <strong class="article-nav-caption">上一篇</strong>
        <div class="article-nav-title">
          
            计算机组成原理-03-校验码
          
        </div>
      </a>
    
    
      <a href="/2021/03/25/Leetcode/Leetcode-083-%E5%88%A0%E9%99%A4%E6%8E%92%E5%BA%8F%E9%93%BE%E8%A1%A8%E4%B8%AD%E7%9A%84%E9%87%8D%E5%A4%8D%E5%85%83%E7%B4%A0I/" class="article-nav-link">
        <strong class="article-nav-caption">下一篇</strong>
        <div class="article-nav-title">Leetcode--083-删除排序链表中的重复元素I</div>
      </a>
    
  </nav>


  

  
  
<!-- valine评论 -->
<div id="vcomments-box">
    <div id="vcomments">
    </div>
</div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='https://cdn.jsdelivr.net/npm/valine@1.3.10/dist/Valine.min.js'></script>
<script>
    new Valine({
        el: '#vcomments',
        notify: false,
        verify: '',
        app_id: '',
        app_key: '',
        path: window.location.pathname,
        avatar: 'mp',
        placeholder: '给我的文章加点评论吧~',
        recordIP: true
    });
    const infoEle = document.querySelector('#vcomments .info');
    if (infoEle && infoEle.childNodes && infoEle.childNodes.length > 0) {
        infoEle.childNodes.forEach(function (item) {
            item.parentNode.removeChild(item);
        });
    }
</script>
<style>
    #vcomments-box {
        padding: 5px 30px;
    }

    @media screen and (max-width: 800px) {
        #vcomments-box {
            padding: 5px 0px;
        }
    }

    #vcomments-box #vcomments {
        background-color: #fff;
    }

    .v .vlist .vcard .vh {
        padding-right: 20px;
    }

    .v .vlist .vcard {
        padding-left: 10px;
    }
</style>

  

  
  
<div class="gitalk" id="gitalk-container"></div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1.5.0/dist/gitalk.css">


<script src="https://cdn.jsdelivr.net/npm/gitalk@1.5.0/dist/gitalk.min.js"></script>


<script src="https://cdn.jsdelivr.net/npm/blueimp-md5@2.10.0/js/md5.min.js"></script>

<script type="text/javascript">
  var gitalk = new Gitalk({
    clientID: 'db188ed8c86dc4b0dbf3',
    clientSecret: 'a58f92160e5a9efd726b7d533000a0737f3e3f3e',
    repo: 'Blog-comments',
    owner: 'Zhuuuuuuuu',
    admin: ['Zhuuuuuuuu'],
    // id: location.pathname,      // Ensure uniqueness and length less than 50
    id: md5(location.pathname),
    distractionFreeMode: false,  // Facebook-like distraction free mode
    pagerDirection: 'last'
  })

  gitalk.render('gitalk-container')
</script>

  

</article>
</section>
      <footer class="footer">
  <div class="outer">
    <ul class="list-inline">
      <li>
        &copy;
        2019-2021
        Zhuuu
      </li>
      <li>
        
      </li>
    </ul>
    <ul class="list-inline">
      <li>
        
        
        <span>
  <i>PV:<span id="busuanzi_value_page_pv"></span></i>
  <i>UV:<span id="busuanzi_value_site_uv"></span></i>
</span>
        
      </li>
      <li>
        <!-- cnzz统计 -->
        
        <script type="text/javascript" src='https://s9.cnzz.com/z_stat.php?id=1278069914&amp;web_id=1278069914'></script>
        
      </li>
    </ul>
  </div>
</footer>
    <div class="to_top">
        <div class="totop" id="totop">
  <i class="ri-arrow-up-line"></i>
</div>
      </div>
    </main>
      <aside class="sidebar">
        <button class="navbar-toggle"></button>
<nav class="navbar">
  
  <div class="logo">
    <a href="/"><img src="/images/ayer-side.svg" alt="朱酱酱的学习博客"></a>
  </div>
  
  <ul class="nav nav-main">
    
    <li class="nav-item">
      <a class="nav-item-link" href="/">主页</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags">标签</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/JVM/">JVM</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/JDK%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/">JDK源码</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E5%A4%9A%E7%BA%BF%E7%A8%8B/">多线程</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Mysql/">Mysql</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Redis/">Redis</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E8%AE%BE%E8%AE%A1%E8%80%85%E6%A8%A1%E5%BC%8F/">设计模式</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/MyBatis/">MyBatis</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/SpringMVC/">SpringMVC</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Spring/">Spring</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/SpringBoot/">SpringBoot</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">Linux</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/Leetcode/">Leetcode</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E5%89%8D%E7%AB%AF/">前端</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/">网络编程</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/tags/photoshop/">photoshop</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="http://smartzhuuu.lofter.com/" target="_blank" rel="noopener">摄影</a>
    </li>
    
    <li class="nav-item">
      <a class="nav-item-link" href="/2020/about">关于我</a>
    </li>
    
  </ul>
</nav>
<nav class="navbar navbar-bottom">
  <ul class="nav">
    <li class="nav-item">
      
      <a class="nav-item-link nav-item-search"  title="Search">
        <i class="ri-search-line"></i>
      </a>
      
      
      <a class="nav-item-link" target="_blank" href="/atom.xml" title="RSS Feed">
        <i class="ri-rss-line"></i>
      </a>
      
    </li>
  </ul>
</nav>
<div class="search-form-wrap">
  <div class="local-search local-search-plugin">
  <input type="search" id="local-search-input" class="local-search-input" placeholder="Search...">
  <div id="local-search-result" class="local-search-result"></div>
</div>
</div>
      </aside>
      <div id="mask"></div>

<!-- #reward -->
<div id="reward">
  <span class="close"><i class="ri-close-line"></i></span>
  <p class="reward-p"><i class="ri-cup-line"></i>请我喝杯咖啡吧~</p>
  <div class="reward-box">
    
    <div class="reward-item">
      <img class="reward-img" src="/images/alipay.jpg">
      <span class="reward-type">支付宝</span>
    </div>
    
    
    <div class="reward-item">
      <img class="reward-img" src="/images/wechat.jpg">
      <span class="reward-type">微信</span>
    </div>
    
  </div>
</div>
      
<script src="/js/jquery-2.0.3.min.js"></script>


<script src="/js/jquery.justifiedGallery.min.js"></script>


<script src="/js/lazyload.min.js"></script>


<script src="/js/busuanzi-2.3.pure.min.js"></script>


<script src="/js/share.js"></script>



<script src="/fancybox/jquery.fancybox.min.js"></script>




<script>
  try {
    var typed = new Typed("#subtitle", {
    strings: ['昨夜西风凋碧树。独上高楼，望尽天涯路','衣带渐宽终不悔，为伊消得人憔悴。','众里寻他千百度。蓦然回首，那人却在，灯火阑珊处。'],
    startDelay: 0,
    typeSpeed: 200,
    loop: true,
    backSpeed: 100,
    showCursor: true
    });
  } catch (err) {
  }
  
</script>




<script src="/js/tocbot.min.js"></script>

<script>
  // Tocbot_v4.7.0  http://tscanlin.github.io/tocbot/
  tocbot.init({
    tocSelector: '.tocbot',
    contentSelector: '.article-entry',
    headingSelector: 'h1, h2, h3, h4, h5, h6',
    hasInnerContainers: true,
    scrollSmooth: true,
    scrollContainer:'main',
    positionFixedSelector: '.tocbot',
    positionFixedClass: 'is-position-fixed',
    fixedSidebarOffset: 'auto',
    onClick: (e) => {
      $('.toc-link').removeClass('is-active-link');
      $(`a[href=${e.target.hash}]`).addClass('is-active-link');
      $(e.target.hash).scrollIntoView();
      return false;
    }
  });
</script>


<script>
  var ayerConfig = {
    mathjax: true
  }
</script>


<script src="/js/ayer.js"></script>


<script src="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/jquery-modal@0.9.2/jquery.modal.min.css">


<!-- Root element of PhotoSwipe. Must have class pswp. -->
<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

    <!-- Background of PhotoSwipe. 
         It's a separate element as animating opacity is faster than rgba(). -->
    <div class="pswp__bg"></div>

    <!-- Slides wrapper with overflow:hidden. -->
    <div class="pswp__scroll-wrap">

        <!-- Container that holds slides. 
            PhotoSwipe keeps only 3 of them in the DOM to save memory.
            Don't modify these 3 pswp__item elements, data is added later on. -->
        <div class="pswp__container">
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
            <div class="pswp__item"></div>
        </div>

        <!-- Default (PhotoSwipeUI_Default) interface on top of sliding area. Can be changed. -->
        <div class="pswp__ui pswp__ui--hidden">

            <div class="pswp__top-bar">

                <!--  Controls are self-explanatory. Order can be changed. -->

                <div class="pswp__counter"></div>

                <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>

                <button class="pswp__button pswp__button--share" style="display:none" title="Share"></button>

                <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>

                <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>

                <!-- Preloader demo http://codepen.io/dimsemenov/pen/yyBWoR -->
                <!-- element will get class pswp__preloader--active when preloader is running -->
                <div class="pswp__preloader">
                    <div class="pswp__preloader__icn">
                        <div class="pswp__preloader__cut">
                            <div class="pswp__preloader__donut"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
                <div class="pswp__share-tooltip"></div>
            </div>

            <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
            </button>

            <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
            </button>

            <div class="pswp__caption">
                <div class="pswp__caption__center"></div>
            </div>

        </div>

    </div>

</div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.css">
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js"></script>

<script>
    function viewer_init() {
        let pswpElement = document.querySelectorAll('.pswp')[0];
        let $imgArr = document.querySelectorAll(('.article-entry img:not(.reward-img)'))

        $imgArr.forEach(($em, i) => {
            $em.onclick = () => {
                // slider展开状态
                // todo: 这样不好，后面改成状态
                if (document.querySelector('.left-col.show')) return
                let items = []
                $imgArr.forEach(($em2, i2) => {
                    let img = $em2.getAttribute('data-idx', i2)
                    let src = $em2.getAttribute('data-target') || $em2.getAttribute('src')
                    let title = $em2.getAttribute('alt')
                    // 获得原图尺寸
                    const image = new Image()
                    image.src = src
                    items.push({
                        src: src,
                        w: image.width || $em2.width,
                        h: image.height || $em2.height,
                        title: title
                    })
                })
                var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, {
                    index: parseInt(i)
                });
                gallery.init()
            }
        })
    }
    viewer_init()
</script>



<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
      tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
  });

  MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for(i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
      }
  });
</script>

<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.6/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>


<script type="text/javascript" src="https://js.users.51.la/20544303.js"></script>
  </div>
</body>

</html>